<div ng-controller="AdministratorMangeController as vm">
 <h1 class="page-title">管理员管理</h1>
  <div class="btn-toolbar">
    <div class="btn-group">
      <a class="btn" ng-click="vm.createAdminUser()">新增管理员</a>
    </div>
  </div>
  <div class="well table-well">
    
    <div class="table-responsive">
      <table class="table table-striped table-bordered">
        <thead>
          <tr>
            <th>#ID</th>
            <th>会员号</th>
            <th>电子邮箱</th>
            <th>手机号</th>
            <th>注册时间</th>
            <th>最后登录时间</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="user in vm.users">
            <td>{{user.id}}</td>
            <td>{{user.memberId}}</td>
            <td>{{user.email}}</td>
            <td>{{user.mobile}}</td>
            <td>{{user.creationDate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
            <td>{{user.lastLogin | date:'yyyy-MM-dd HH:mm:ss'}}</td>
            <td>{{user.valid == true ? '有效' : '无效'}}</td>
            <td>
              <div class="btn-group">
                <a class="btn btn-primary dropdown-toggle" data-target="#" data-toggle="dropdown">
                  用户操作
                  <span class="caret"></span>
                </a>
                <ul class="dropdown-menu">
                  <li ng-show="user.memberId!='0500001'"><a ng-click="vm.deleteUser(user.id)">删除用户</a></li>
                  <li><a ng-click="vm.editAdminUser(user)">编辑用户</a></li>
                </ul>
              </div>
            </td>
          </tr>   
        </tbody>
      </table>
    </div>
     <p ng-show="vm.noRecord">没有找到符合条件的数据！</p>
  </div>
      <div class="pagination pagination-centered" ng-show="!vm.noRecord">
        <ul>
         <li ng-class="vm.firstPage? 'disabled':''" ng-switch="vm.firstPage">
         <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage-1)" >&laquo;</a>
         <a ng-switch-when="true" >&laquo;</a>
         </li>
          <li ng-repeat="me in vm.pages" ng-class="me==vm.currentPage? 'active':''" ng-switch="me==vm.currentPage">
            <a ng-switch-when="false" ng-click="vm.loadPage(me)" >{{me}}</a>
            <a ng-switch-when="true" >{{me}}</a>
            </li>
          <li ng-class="vm.lastPage? 'disabled':''" ng-switch on="vm.lastPage">
          <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage+1)">&raquo;</a>
          <a ng-switch-when="true" >&raquo;</a>
          </li>
        </ul>
      </div>

</div>